From fb57267cd6b2a3e487e8fa4d139c99bf0897ff63 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Tue, 21 Mar 2006 12:25:23 +0100 Subject: [PATCH] Only send the OFFLINE hotplug event if be->netif is set. Firstly, this ensures that OFFLINE is only sent if the ONLINE event has been sent. Secondly, this fixes one possible cause of the reopened bug #549 as it prevents be->netif being dereferenced inside netback_uevent. Early reports suggest that this is not the only cause of #549, so that bug remains open for now. Signed-off-by: Ewan Mellor --- linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c index 526e02ab0a..52a4fc98c8 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c @@ -213,7 +213,8 @@ static void frontend_changed(struct xenbus_device *dev, break; case XenbusStateClosed: - kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); + if (be->netif != NULL) + kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); device_unregister(&dev->dev); break; -- 2.30.2